package com.qf.service.impl;

import com.qf.dao.AccountDao;

import com.qf.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @version 1.0
 * 公众号：Java架构栈
 * @Author: 卓不凡
 */
public class AccountServiceImpl implements AccountService {
    //private     AccountDao accountDao = new AccountDaoImpl();
    //新增账户
    public AccountServiceImpl(){
        System.out.println("servicewucan");
    }
    public void addAccount() {
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("bean.xml");
        AccountDao accountDao=(AccountDao) applicationContext.getBean("accountDao");
        accountDao.addAccount();
    }
}
